(define "Line3D" (!= 0 (count Sites in:(forEach (expand (sites Bottom) steps:(- 1)) if:(all Sites if:(= (mover) (who at:(site))) ) ) ) ) ) //------------------------------------------------------------------------------ (game "3D Tic-Tac-Toe" (players 2) (equipment { (board (rectangle (+ (^ 2) (- 1)) )) (piece "Disc" P1) (piece "Cross" P2) (piece "Dot" Neutral) }) (rules (start (place "Dot0" )) // Places neutral dots to separate the four levels of the board. (play (move Add (to (sites Empty)))) (end { (if (is Line ) (result Mover Win)) (if "Line3D" (result Mover Win)) }) ) ) //------------------------------------------------------------------------------ (option "Board Size" args:{ <3dSites>} { (item "3x3x3" <3> <(union {(sites Row 3) (sites Row 7)})> <(sites {(site) (ahead (site) steps:4 N) (ahead (site) steps:8 N)})> "The game is played on a 3x3x3 board." )* (item "4x4x4x4" <4> <(union {(sites Row 4) (sites Row 9) (sites Row 14)})> <(sites {(site) (ahead (site) steps:5 N) (ahead (site) steps:10 N) (ahead (site) steps:15 N)})> "The game is played on a 4x4x4 board." ) }) //------------------------------------------------------------------------------ (metadata (info { (description "Tic-Tac-Toe on a nxnxn grid") (aliases {"Qubic"}) (rules "Play occurs on a 4x4x4 grid. One player places an X, the other places an O and players take turns placing their marks in the grid, attempting to get four in a row of their color. For the lines between levels, the diagonals are not taken in account.") (id "1391") (source "BGG") (version "1.3.12") (classification "board/space/line") (author "Woodrow Arthur Heacock, Herbert B. Swift, William Spyker") (credit "Ben Ritter") (date "23-08-1941") } ) (graphics (piece Scale "Dot" 0.333)) (ai "3D Tic-Tac-Toe_ai" ) )